#7-1 字符串拼接操作【字符串】
def str_sub():
    symbol = input()
    length = int(input())
    date = input()

    # 对日期进行格式化
    year, month, day = date.split('/')
    formatDate = f"{year}年{int(month):02d}月{int(day):02d}日"

    print(symbol * length)
    print(formatDate)
    print(symbol * length)
str_sub()